package org.halo.trade.data.sina;


public class Level2_ZJLXinfo
{
	public double[][] mf = new double[2][4];
	public String symbol;

	public double getMainNetIn()
	{
		double main_buy = mf[0][0] + mf[0][1];
		double main_sell = mf[1][0] + mf[1][1];
		double main_net_in = main_buy - main_sell;
		return main_net_in;
	}

	public double getAmount()
	{
		double total = 0;
		for (int j = 0; j < 4; j++)
		{
			total += mf[0][j];
		}
		return total;
	}
	
	public double getMainNetInRate()
	{
		return getMainNetIn() / getAmount();
	}
	
	public double getExtremeNetIn()
	{
		double extreme_net = mf[0][0]-mf[1][0];
		return extreme_net;
	}
	



	public void print()
	{
		System.out.println("===============================");
		System.out.println(symbol);

		System.out.println("流入：");
		for (int j = 0; j < 4; j++)
		{
			System.out.print(mf[0][j] / 10000 + "\t");
		}
		System.out.println();
		System.out.println("流出：");
		for (int j = 0; j < 4; j++)
		{
			System.out.print(mf[1][j] / 10000 + "\t");
		}
		System.out.println();

		System.out.println("净流入：");
		for (int j = 0; j < 4; j++)
		{
			System.out.print((mf[0][j] - mf[1][j]) / 10000 + "\t");
		}
		System.out.println();

		// double total = 0;
		// for (int j = 0; j < 4; j++)
		// {
		// total += (mf[0][j] + mf[1][j]);
		// }
		// System.out.println("净流入率：" + netamount / total * 100);

		// double main_buy = mf[0][0] + mf[0][1];
		// double main_sell = mf[1][0] + mf[1][1];
		//
		// double main_net_in = main_buy - main_sell;
		// double percent_main_net_in = main_net_in * 100.0 / total;
		//
		// System.out.println("主力净流入率：" + percent_main_net_in);
	}

}
